﻿
@model IEnumerable<Student>
@{
   // Layout = "~/Views/Shared/_Layout.cshtml";
    //ViewData["Title"] = "Index";
    //ViewBag.Title = ViewBag.Title;
}

<div class="card-deck">
    @foreach (var item in Model)
   {    
       var PhotePath = "~/images/" + (item.PhotePath ?? "image1.png");
       if (item.Id>4)
        {
            PhotePath = "~/images/avatars/one/" + (item.PhotePath ?? "image1.png"); 
        }
        
        @*<div class="col-sm-3">*@
       <div class="card m-3">
           <div class="card-header">
               <h3 class="card-title">@item.Name</h3>
           </div>
           <img class="card-img-top" src="@PhotePath" asp-append-version="true"/>
            <div class="card-body text-center">
                <h4 class="card-title">主修科目:@item.Major.GetDisplayName()</h4>
            </div>
            <div class="card-footer text-center">
                <a asp-controller="home" asp-action="details" asp-route-id="@item.Id" class="btn btn-info">查看</a>
                <a asp-action="Edit" asp-controller="home" asp-route-id="@item.Id" class="btn btn-primary m-1">编辑</a>
                <a asp-controller="home" asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger m-1">删除</a>
                <a asp-controller="home" asp-action="codeCu" asp-route-id="@item.Id" class="btn btn-danger m-1">异常</a>
            </div>
       </div>
       
      @*</div>*@
       
   }
</div>
